
****************************************************************
******		TABLE 2			 		****************************
****************************************************************
	*use dataTab2  /*Download the data -- specify path first*/
	tsset id yr
	gen ly=log(rgdpch)
	gen gr=D1.ly


**********************************
**** Terrorism divided by 1000:	
**********************************
	foreach v of varlist ter dter iter {
		gen n`v'=`v'/1000
	}

************* Results columns 1-6
	foreach v of varlist nter ndter niter {
		qui xtreg gr L1.ly `v' i.yr, fe vce(rob)  /*Conventional World*/
		est store feA`v'
		qui xtreg gr `v' i.yr, fe vce(rob) /* Unit Root Restriction World*/
		est store feB`v'
			forvalues i=1/5 { 			/*Amer=1;Asia=2;MENA=3;SSAfrica=4;WEur=5*/
				qui xtreg gr L1.ly `v' i.yr if region==`i', fe vce(rob)  
				est store feA`i'`v'
					qui xtreg gr `v' i.yr if region==`i', fe vce(rob)  
					est store feB`i'`v'				
	}
	}

**** TABLE ROWS
est table feAn* feBn*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns)  /* World */
est table feA1* feB1*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns)  /*America*/
est table feA2* feB2*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns) /*Asia*/
est table feA3* feB3*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns)	/*ME&NA*/
 est table feA4* feB4*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns)	/*S.S. Africa*/
est table feA5* feB5*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns)	/*W. Europe*/ 


****************************************	
**** Terrorism divided by population:
****************************************
	estimates clear
	drop n*
	foreach v of varlist ter dter iter {
	gen n`v'=`v'/pop
	}

************* Results columns 1-6
	foreach v of varlist nter ndter niter {
		qui xtreg gr L1.ly `v' i.yr, fe vce(rob)  /*Conventional World*/
		est store feA`v'
		qui xtreg gr `v' i.yr, fe vce(rob) /* Unit Root Restriction World*/
		est store feB`v'
			forvalues i=1/5 { 			/*Amer=1;Asia=2;MENA=3;SSAfrica=4;WEur=5*/
				qui xtreg gr L1.ly `v' i.yr if region==`i', fe vce(rob)  
				est store feA`i'`v'
					qui xtreg gr `v' i.yr if region==`i', fe vce(rob)  
					est store feB`i'`v'				
	}
	}


**** TABLE ROWS
est table feAn* feBn*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns)  /* World */
est table feA1* feB1*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns)  /*America*/
est table feA2* feB2*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns) /*Asia*/
est table feA3* feB3*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns)	/*ME&NA*/
 est table feA4* feB4*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns)	/*S.S. Africa*/
est table feA5* feB5*, b(%7.3f) /*p(%7.3f) t(%7.3f)*/ star(.1 .05 .01) keep(nter ndter niter) ///
 style(columns)	/*W. Europe*/ 

*** NOTE Collect all above results together to get columns 1-6 of Table 2. Columns 7-9 are simply the ///
*** difference between associated results of conventional (col 1-3) and unit root restr. (col 4-6) outputs 
